package org.zjvis.datascience.common.dto;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.zjvis.datascience.common.util.DozerUtil;
import org.zjvis.datascience.common.vo.PluginInstanceVO;

import java.time.LocalDateTime;

@Data
public class PluginInstanceDTO extends BaseDTO {
    private Long id;
    private Long pluginId;
    private Long userId;
    private String status;
    private String dataJson;
    private String logInfo;
    private Long duringTime;
    private Integer progress;
    private LocalDateTime gmtRunning;

    public PluginInstanceVO view() {
        PluginInstanceVO vo = DozerUtil.mapper(this, PluginInstanceVO.class);
        vo.setData(JSONObject.parseObject(this.getDataJson()));
        return vo;
    }

}
